package com.example.product_practices.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.product_practices.domain.ReplyTb;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Mapper
@Transactional(rollbackFor = Exception.class)
public interface ReplyTbMapper extends BaseMapper<ReplyTb> {
    @Select("select count(*) from reply_tb,question where reply_tb.replier_id=#{userId} and question.naire_id=#{questionnaireId} " +
            "and reply_tb.content=question.sta_ans and reply_tb.ques_id=question.id ")
    int countmark(@Param("userId") Integer userId, @Param("questionnaireId") Integer questionnaireId);

}
